<template>
  <div class="userLayout">
    <a-row class="login" type="flex" justify="center">
      <a-col :span="6">
        <div class="header">
          <span class="title">设置请求地址</span>
        </div>
        <div>
          <a-input size="large" placeholder="请输入请求地址" v-model="apiurl" />
          <div class="example">例如：http://127.0.0.1:10002/api/</div>
          <a-button type="primary" @click="save">保存 </a-button>
        </div>
      </a-col>
    </a-row>
  </div>
</template>
<script>
export default {
  metaInfo: {
    title: "设置请求地址",
  },
  data() {
    return {
      apiurl: "",
    };
  },

  mounted() {
      if(localStorage.getItem("apiUrl")){
          this.$router.push("/Auth/login");
      }
  },
  methods: {
    save() {
      localStorage.setItem("apiUrl",this.apiurl);
      this.$router.go(0)
    },
  },
};
</script>
<style scoped>
.userLayout {
  height: 100%;
  overflow: auto;
}
.login {
  background: #f0f2f5 url(../../assets/background.a568162c.svg) repeat 100%;
  background-size: 100% 100%;
  padding: 110px 0 144px;
  position: relative;
  height: 100%;
}
.login .header {
  height: 44px;
  line-height: 44px;
  text-align: center;
  margin-bottom: 30px;
}
.login .title {
  font-size: 33px;
  color: rgba(0, 0, 0, 0.85);
  font-weight: 600;
  position: relative;
  top: 2px;
}
.example{
    font-size: 14px;
    color: rgb(167, 167, 167);
    margin-top: 10px;
    margin-bottom: 10px;
}
</style>